<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    hello world
    <script>
        let arr = [1, 2, 3];
        // map迭代器 不会改变数组的个数 可以改变数组的内容
        let arr1 = arr.map((item, index, arr) => {
            console.log(item, index, arr);
            console.log('----------------');
            if (item > 2) return item
        })
        console.log(arr1, '新数组')

        let obj = {
            a: 'a',
            b: 'b',
            c: 'c'
        }
        // 数组删除属性
        let arr2=[2,3,4];
        console.log(arr2)
        // 修改原来的数组
        arr2.splice(0,1)
        // 数组占空
        delete arr2[0]
        console.log(arr2)
        // 对象删除属性
        console.log(obj)
        delete obj.a
        console.log(obj)

    </script>
</body>

</html>